<template>
    <block v-if="scene == 1154">
    	<pyq-open-chunk></pyq-open-chunk>
    </block>
    <block v-else>
        <view class="page bg-fff">
            <view class="topWrap bg-theme col-fff">
                <view class="priceImgGroup flex">
                    <view class="priceGroup flex">
                        <view class="priceItem">
                            <view class="priceItemTitle font10">所购房屋原始总价</view>
                            <view class="priceItemValue">
                                <text class="font25 fontBold fontNum">100.00</text>
                                <text class="font12">万</text>
                            </view>
                        </view>
                        <view class="priceItem">
                            <view class="priceItemTitle font10">所购房屋原始单价</view>
                            <view class="priceItemValue">
                                <text class="font25 fontBold fontNum">100.00</text>
                                <text class="font12">万/㎡</text>
                            </view>
                        </view>
                    </view>

                    <view class="qrcodeWrap bg-fff flex">
                        <image class="qrcodeImg" src="https://shoss.ipangsell.com/qrcode/gongzhonghao-qrcode-sh.jpg" mode="widthFix"></image>
                    </view>
                </view>

                <view class="resultTitle top-15">为您计算的房屋保本结果如下：</view>

            </view>
        </view>
    </block>
</template>

<script>
    import { mapState } from 'pinia';
    import { useUserInfoStore, useConfigStore } from '@/store/index';
	export default {
		data() {
			return {
				
			}
		},
        computed:{
        	...mapState(useUserInfoStore, ['userInfo']),
            ...mapState(useConfigStore, ['scene'])
        },
        onShareAppMessage(res) {
            return {
                title: `保本计算器`,
                path: `/pages/tools/calculator/capital-preservation-calculate?puid=${this.userInfo.id}`,
            }
        },
        
        onShareTimeline() {
            return {
                title: `保本计算器`,
                query: `puid=${this.userInfo.id}`
            }
        },
        
		onLoad(options) {
            //朋友圈进入小程序快照场景
            if(this.scene == 1154) return;

            let formObj = JSON.parse(decodeURIComponent(options.formObj));
            console.log(formObj);
            this.sy_amount = parseFloat(formObj.houseAmount);
            this.sy_rate = parseFloat(formObj.housePrice);
            this.gjj_amount = parseFloat(formObj.loanAmountGJJ);
            this.gjj_rate = parseFloat(formObj.gongjjLilv);
            this.calcFun();
            uni.$check_and_login();
		},
		methods: {
			
		}
	}
</script>

<style lang="scss" scoped>
	.page{
		min-height: 100vh;
		overflow: hidden;
        .topWrap{
            padding: 30rpx;
            .priceImgGroup{
                padding: 30rpx 0;
                justify-content: space-between;
                border-bottom: 2rpx dashed #ffffff;
                .priceGroup{
                    flex: 1;
                    .priceItem{
                        width: calc(50% - 15rpx);
                    }
                }
                .qrcodeWrap{
                    width: 150rpx;
                    height: 150rpx;
                    border-radius: 50%;
                    padding: 10rpx;
                    overflow: hidden;
                    .qrcodeImg{
                        width: 130rpx;
                        height: 130rpx;
                    }
                }
            }
        }
	}
</style>
